* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Noto Serif SC', serif;
}

body {
  background-color: #0a0a0a;
  overflow-x: hidden;
  min-height: 100vh;
}

.app-container {
  position: relative;
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem 1rem;
  color: #f0e6d2;
  background-image: 
    url('https://picsum.photos/id/1082/1920/1080'),
    radial-gradient(circle at center, rgba(30, 10, 10, 0.8) 0%, rgba(0, 0, 0, 0.95) 100%);
  background-blend-mode: overlay;
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
  box-shadow: 0 0 50px rgba(0, 0, 0, 0.8) inset;
}

.app-container::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: url('https://picsum.photos/id/122/1920/1080');
  background-size: cover;
  background-position: center;
  opacity: 0.03;
  pointer-events: none;
  z-index: -1;
}

.app-container h1 {
  color: #e6b89c;
  margin-bottom: 2rem;
  font-size: 2.5rem;
  text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.8);
  letter-spacing: 0.2rem;
  text-align: center;
  position: relative;
  padding-bottom: 1rem;
}

.app-container h1::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 120px;
  height: 2px;
  background: linear-gradient(90deg, transparent, #d4af37, transparent);
}

.game-info {
  max-width: 700px;
  margin: 0 auto 3rem;
  padding: 1.5rem;
  background-color: rgba(0, 0, 0, 0.7);
  border-radius: 8px;
  border: 1px solid rgba(212, 175, 55, 0.2);
  text-align: center;
  line-height: 1.8;
  position: relative;
}

.game-info::before {
  content: '';
  position: absolute;
  top: -5px;
  left: -5px;
  right: -5px;
  bottom: -5px;
  border: 1px solid rgba(212, 175, 55, 0.1);
  border-radius: 10px;
  pointer-events: none;
}

.attempts-left {
  color: #ff6b6b;
  font-weight: bold;
  margin: 1rem 0;
  font-size: 1.1rem;
}

.hint-btn {
  background-color: rgba(212, 175, 55, 0.2);
  color: #d4af37;
  border: 1px solid rgba(212, 175, 55, 0.4);
  padding: 6px 12px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 0.9rem;
  margin-top: 0.5rem;
}

.hint-btn:hover {
  background-color: rgba(212, 175, 55, 0.3);
  transform: translateY(-2px);
}

.hint {
  margin-top: 1rem;
  padding: 1rem;
  background-color: rgba(0, 0, 0, 0.6);
  border-left: 3px solid #d4af37;
  color: #e6b89c;
  font-style: italic;
  animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.door-frame {
  max-width: 1000px;
  height: 600px;
  margin: 0 auto 2rem;
  position: relative;
  background-color: #1a0f0a;
  border: 15px solid #2d1b11;
  border-radius: 5px;
  box-shadow: 0 0 50px rgba(0, 0, 0, 0.8), 
              inset 0 0 30px rgba(0, 0, 0, 0.5);
  overflow: hidden;
}

.door-frame::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 30px;
  background: linear-gradient(to bottom, #2d1b11, transparent);
  z-index: 1;
}

.door-frame::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 30px;
  background: linear-gradient(to top, #2d1b11, transparent);
  z-index: 1;
}

/* 门后场景样式 */
.behind-door-scene {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  z-index: 0;
  opacity: 0.9;
}

.behind-door-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: brightness(0.4) saturate(0.8) contrast(0.9);
  transition: filter 3s ease, transform 5s ease;
  transform: scale(1.05);
}

/* 门打开时增强图片效果 */
.door.open-left ~ .behind-door-scene .behind-door-image {
  filter: brightness(0.9) saturate(1.1) contrast(1.1);
  transform: scale(1);
}

.door {
  width: 50%;
  height: 100%;
  background-color: #8b0000;
  position: relative;
  transition: transform 3s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: 0 0 30px rgba(0, 0, 0, 0.3) inset;
  background-image: 
    linear-gradient(90deg, rgba(0,0,0,0.2) 0%, transparent 15%, transparent 85%, rgba(0,0,0,0.2) 100%),
    url('https://picsum.photos/id/106/800/1200');
  background-size: cover;
  background-blend-mode: overlay;
}

.door-texture {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: 
    linear-gradient(rgba(0,0,0,0.1) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0,0,0,0.1) 1px, transparent 1px);
  background-size: 30px 30px;
  opacity: 0.7;
}

.left-door {
  border-right: 8px solid #5c0000;
  transform-origin: left center;
  background-position: left center;
  z-index: 2;
}

.right-door {
  position: absolute;
  top: 0;
  right: 0;
  border-left: 8px solid #5c0000;
  transform-origin: right center;
  background-position: right center;
  z-index: 2;
}

.door-hinges {
  position: absolute;
  top: 50%;
  left: 0;
  transform: translateY(-50%);
  width: 15px;
  height: 200px;
  background-color: #3a2618;
  border-radius: 0 8px 8px 0;
  box-shadow: 3px 0 5px rgba(0, 0, 0, 0.3) inset;
}

.hinge-pin {
  position: absolute;
  width: 25px;
  height: 25px;
  border-radius: 50%;
  background-color: #2c1e12;
  left: -5px;
  border: 2px solid #1a120a;
  box-shadow: 0 0 5px rgba(0, 0, 0, 0.3) inset,
              0 2px 3px rgba(0, 0, 0, 0.3);
}

.hinge-pin:first-child { top: 0; }
.hinge-pin:last-child { bottom: 0; }

.right-hinges {
  left: auto;
  right: 0;
  border-radius: 8px 0 0 8px;
  box-shadow: -3px 0 5px rgba(0, 0, 0, 0.3) inset;
}

.right-hinges .hinge-pin {
  left: auto;
  right: -5px;
}

.door-decoration {
  background-color: #d4af37;
  position: absolute;
  border: 2px solid #b8860b;
  box-shadow: 0 3px 5px rgba(0, 0, 0, 0.3);
}

.top-left, .top-right {
  width: 80px;
  height: 12px;
  top: 150px;
  border-radius: 4px;
}

.bottom-left, .bottom-right {
  width: 80px;
  height: 12px;
  bottom: 150px;
  border-radius: 4px;
}

.top-left, .bottom-left {
  left: 50%;
  transform: translateX(-70%);
}

.top-right, .bottom-right {
  right: 50%;
  transform: translateX(70%);
}

/* 门环效果 */
.top-left::after, .bottom-left::after,
.top-right::after, .bottom-right::after {
  content: '';
  position: absolute;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background-color: #b8860b;
  border: 3px solid #8b6914;
  top: 50%;
  transform: translateY(-50%);
  box-shadow: 0 0 5px rgba(0, 0, 0, 0.3) inset;
}

.top-left::after, .bottom-left::after { right: -15px; }
.top-right::after, .bottom-right::after { left: -15px; }

.lock-container {
  position: absolute;
  width: 240px;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.password-display {
  display: flex;
  gap: 12px;
  margin-bottom: 30px;
  background-color: #2d2d2d;
  padding: 18px 25px;
  border-radius: 8px;
  border: 4px solid #3a3a3a;
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.5),
              inset 0 0 10px rgba(0, 0, 0, 0.7);
  position: relative;
}

.password-display::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.1), transparent);
}

.digit-box {
  width: 45px;
  height: 55px;
  background-color: #1a1a1a;
  border: 2px solid #444;
  border-radius: 5px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  color: #f0e6d2;
  font-family: 'Courier New', monospace;
  position: relative;
  overflow: hidden;
  box-shadow: 0 2px 3px rgba(0, 0, 0, 0.5) inset;
}

.digit-box::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 50%;
  background: linear-gradient(
    to bottom,
    rgba(255, 255, 255, 0.08) 0%,
    rgba(255, 255, 255, 0) 100%
  );
}

.digit-box.active {
  border-color: #d4af37;
  box-shadow: 0 0 15px rgba(212, 175, 55, 0.5),
              0 0 5px rgba(212, 175, 55, 0.3) inset;
}

.digit-box.active::before {
  content: '';
  position: absolute;
  width: 2px;
  height: 35px;
  background-color: #d4af37;
  animation: blink 1s infinite;
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

.keypad {
  display: flex;
  flex-direction: column;
  gap: 12px;
  background-color: #3a2e21;
  padding: 25px;
  border-radius: 10px;
  border: 6px solid #2c1e12;
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.5),
              inset 0 0 15px rgba(0, 0, 0, 0.4);
  position: relative;
}

.keypad::before {
  content: '';
  position: absolute;
  top: 10px;
  left: 10px;
  right: 10px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.05), transparent);
}

.keypad-row {
  display: flex;
  gap: 12px;
}

.digit-btn {
  width: 55px;
  height: 55px;
  border-radius: 8px;
  border: none;
  background-color: #2c1e12;
  color: #f0e6d2;
  font-size: 1.3rem;
  cursor: pointer;
  transition: all 0.15s ease;
  box-shadow: 0 4px 0 #1a120a, 
              inset 0 1px 0 rgba(255, 255, 255, 0.1),
              0 0 5px rgba(0, 0, 0, 0.3);
  position: relative;
  overflow: hidden;
}

.digit-btn::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 30%;
  background: linear-gradient(
    to bottom,
    rgba(255, 255, 255, 0.08) 0%,
    rgba(255, 255, 255, 0) 100%
  );
}

.digit-btn:hover {
  background-color: #4a3826;
  box-shadow: 0 4px 0 #1a120a, 
              inset 0 1px 0 rgba(255, 255, 255, 0.15),
              0 0 8px rgba(212, 175, 55, 0.2);
}

.digit-btn:active {
  transform: translateY(2px);
  box-shadow: 0 2px 0 #1a120a,
              inset 0 1px 0 rgba(0, 0, 0, 0.2);
}

.func-btn {
  width: 55px;
  height: 55px;
  border-radius: 8px;
  border: none;
  color: #f0e6d2;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.15s ease;
  box-shadow: 0 4px 0 rgba(0, 0, 0, 0.3),
              inset 0 1px 0 rgba(255, 255, 255, 0.1);
  position: relative;
  overflow: hidden;
}

.func-btn::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 30%;
  background: linear-gradient(
    to bottom,
    rgba(255, 255, 255, 0.08) 0%,
    rgba(255, 255, 255, 0) 100%
  );
}

.delete-btn {
  background-color: #a04000;
  box-shadow: 0 4px 0 #7d3200,
              inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.delete-btn:hover {
  background-color: #c05000;
  box-shadow: 0 4px 0 #7d3200,
              inset 0 1px 0 rgba(255, 255, 255, 0.15),
              0 0 8px rgba(255, 100, 0, 0.3);
}

.delete-btn:active {
  transform: translateY(2px);
  box-shadow: 0 2px 0 #7d3200;
}

.submit-btn {
  background-color: #006400;
  box-shadow: 0 4px 0 #004d00,
              inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.submit-btn:hover {
  background-color: #008000;
  box-shadow: 0 4px 0 #004d00,
              inset 0 1px 0 rgba(255, 255, 255, 0.15),
              0 0 8px rgba(0, 200, 0, 0.3);
}

.submit-btn:active {
  transform: translateY(2px);
  box-shadow: 0 2px 0 #004d00;
}

.notification {
  position: absolute;
  top: -50px;
  padding: 10px 20px;
  border-radius: 5px;
  font-weight: bold;
  animation: fadeInOut 2s forwards;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.3);
  text-align: center;
  min-width: 200px;
}

.success {
  background-color: #4CAF50;
  color: white;
  border: 1px solid #3d8b40;
}

.error {
  background-color: #f44336;
  color: white;
  border: 1px solid #d32f2f;
}

@keyframes fadeInOut {
  0% { opacity: 0; transform: translateY(-10px); }
  20% { opacity: 1; transform: translateY(0); }
  80% { opacity: 1; transform: translateY(0); }
  100% { opacity: 0; transform: translateY(-10px); }
}

.shake {
  animation: shake 0.8s cubic-bezier(.36,.07,.19,.97) both;
}

@keyframes shake {
  10%, 90% { transform: translate(-50%, -50%) translateX(-1px) rotate(-0.5deg); }
  20%, 80% { transform: translate(-50%, -50%) translateX(2px) rotate(0.5deg); }
  30%, 50%, 70% { transform: translate(-50%, -50%) translateX(-4px) rotate(-1deg); }
  40%, 60% { transform: translate(-50%, -50%) translateX(4px) rotate(1deg); }
}

.open-left {
  transform: rotateY(-110deg);
}

.open-right {
  transform: rotateY(110deg);
}

.locked-message, .unlocked-message {
  max-width: 500px;
  margin: 0 auto;
  padding: 25px;
  background-color: rgba(0, 0, 0, 0.85);
  border-radius: 10px;
  border: 2px solid #d4af37;
  text-align: center;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.7);
}

.locked-message p {
  color: #ff6b6b;
  font-size: 1.5rem;
  margin-bottom: 20px;
  line-height: 1.6;
}

.unlocked-message p {
  color: #4CAF50;
  font-size: 1.5rem;
  margin-bottom: 20px;
  line-height: 1.6;
}

.reset-btn {
  background-color: #d4af37;
  color: #1a1a1a;
  border: none;
  padding: 10px 20px;
  border-radius: 5px;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.2s;
  font-size: 1rem;
  box-shadow: 0 4px 0 #b8860b;
}

.reset-btn:hover {
  background-color: #f0c808;
  transform: translateY(-2px);
  box-shadow: 0 6px 0 #b8860b;
}

.reset-btn:active {
  transform: translateY(0);
  box-shadow: 0 4px 0 #b8860b;
}

/* 响应式设计 */
@media (max-width: 900px) {
  .door-frame {
    height: 500px;
  }
}

@media (max-width: 768px) {
  .door-frame {
    height: 450px;
  }
  
  .app-container h1 {
    font-size: 2rem;
  }
  
  .lock-container {
    width: 220px;
  }
  
  .digit-box {
    width: 40px;
    height: 50px;
  }
  
  .digit-btn, .func-btn {
    width: 50px;
    height: 50px;
  }
}

@media (max-width: 576px) {
  .door-frame {
    height: 380px;
    border-width: 10px;
  }
  
  .lock-container {
    width: 190px;
  }
  
  .digit-box {
    width: 35px;
    height: 45px;
    font-size: 1.5rem;
  }
  
  .digit-btn, .func-btn {
    width: 45px;
    height: 45px;
  }
  
  .keypad {
    padding: 15px;
  }
  
  .app-container h1 {
    font-size: 1.8rem;
  }
}
